package com.company.project.utils;

import java.io.File;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

/**
 * 路径工具类
 * 
 * @author
 * 
 */
public class PathUtil
{


	public static void main(String[] args) {
		System.out.println(getPorjectPath());
		System.out.println(getClasspath());
	}

	public static String getPorjectPath() {
		String nowpath = System.getProperty("user.dir") + "/";
		return nowpath;
	}

	/*
	 * 获取classpath
	 */
	public static String getClasspath() {

		String path = Thread.currentThread().getContextClassLoader().getResource("").toString()
				.replaceAll("file:/", "").replaceAll("%20", " ").trim();
		if (path.indexOf(":") != 1) {
			path = File.separator + path;
		}
		return path;
	}



}
